﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CS3230HealthTrackerSystemGUI
{
    /// <summary>
    /// @Author: Chase Cole
    /// @Version: 11/30/2011
    /// 
    /// The StringHolder class based on 'String Value' holds a string
    /// in a wrapper so that datagridviews, and lists will return string values
    /// rather than the public access value of the string(length).
    /// </summary>
    class StringHolder
    {
            //The string stored in the StringHolder.
            private string stringHeld;
            
            /// <summary>
            /// Constructor for String Holder, takes in the string to stored.
            /// </summary>
            /// <param name="stringToHold">String to be held in the StringHolder object.</param>
            public StringHolder(String stringToHold)
            {
                //If the string is null, store the value as a null string.
                if (stringToHold == null)
                {
                    Value = "NULL";
                }
                else
                {
                    Value = stringToHold;
                }
            }

            /// <summary>
            /// Gets and sets the String Holders private variable. 
            /// @StringHeld- StringHolder's private variable to be manipulated.
            /// </summary>
            public string Value { get { return stringHeld; } set { stringHeld = value; } }
    }
}
